#include "Role.h"

Role::Role() {}

Role::Role(double hp, double atk, string name) :hp(hp), maxhp(hp), atk(atk), name(name) {}

Role::Role(string name):name(name) {}

string Role::get_name() const {
	return name;
}

double Role::get_hp()const {
	return hp;
}

double Role::get_maxhp() const {
	return maxhp; 
}

double Role::get_atk() const { 
	return atk; 
}



void Role::add_maxhp(double x) {
	maxhp += x;
}

void Role::add_atk(double x) {
	atk += x; 
}

void Role::add_hp(double x) {
	if (maxhp == 0) {
		hp += x;
	}
	else {
		hp += x;
		hp = hp > maxhp ? maxhp : hp;
	}
}


void Role::set_name(string n) { 
	name = n;
};
void Role::set_hp(double h) { 
	hp = h; 
}
void Role::set_maxhp(double m) { 
	maxhp = m;
}
void Role::set_atk(double a) {
	atk = a; 
}

